home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 January - Disc 2 / Macworld (1999-01) (Disk 2).dmg / Serious Demos / Symbolic Composer 4.2 / Environment / System / DEF / Library / Retrieve / pick-symbol < prev    next >
Lisp/Scheme  |  1998-10-23  |  1KB  |  15 lines

  1. pick-symbol template-description &rest template-descriptions
  2.  
  3. The first item in template-description is a path and the file name of the library. The second item is a random generator seed in the range 0.0000-0.9999. If the item is nil, then initialisation is not performed. The third argument is a fill pattern - a standard symbol pattern - which is used to fill the patterns picked from the library. If the fourth item is a list, it is evaluated, and the return value is used as a template. If it is an atom, then it and all atoms in the rest template-description list are used as templates. If the names exists in the library, the values associated with them are used, and no randomness takes place. Otherwise the template is filled randomly by mapping template symbols to elements in the active library.
  4.  
  5. (setq pat '(a b c d e f c d b a))
  6. (def-symbol
  7.     bass
  8.         (pick-symbol
  9.               ("binary rhythmics:binary-bass" nil nil a b a c a b a b a b a d)
  10.               ("binary rhythmics:binary-bass" 0.46 pat (use-item definition))
  11.               ("binary rhythmics:binary-bass" 0.1 nil 
  12.                      (use-item (symbol-trim 8 (gen-trans a 3))))
  13.      )
  14. )
  15.